package com.linkage.jz.bankruptcy.bean;

import android.text.TextUtils;

import com.google.gson.Gson;
import com.google.gson.JsonObject;

import java.io.Serializable;
import java.util.List;

/**
 * @author AFAP
 * 讨论详情
 */
public class ProTalkDetail implements Serializable {

    private String id; // 话题id
    private String bankruptcyProjectId; // 项目ID
    private String subjectTitle; // 话题标题
    private String subjectDescribe; // 话题标题
    private CommonStatusInfo subjectType; // 话题类型 0-债委会话题; 1-债权人话题
    private long createTime; // 创建时间
    private int cnt; // 回复数
    private int participantNumber;
    private int browseNumber;
    private List<TaskAtta> attachments;
    private UserInfo user;

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getBankruptcyProjectId() {
        return bankruptcyProjectId;
    }

    public void setBankruptcyProjectId(String bankruptcyProjectId) {
        this.bankruptcyProjectId = bankruptcyProjectId;
    }

    public String getSubjectTitle() {
        return subjectTitle;
    }

    public void setSubjectTitle(String subjectTitle) {
        this.subjectTitle = subjectTitle;
    }

    public String getSubjectDescribe() {
        return subjectDescribe;
    }

    public void setSubjectDescribe(String subjectDescribe) {
        this.subjectDescribe = subjectDescribe;
    }

    public CommonStatusInfo getSubjectType() {
        return subjectType;
    }

    public void setSubjectType(CommonStatusInfo subjectType) {
        this.subjectType = subjectType;
    }

    public long getCreateTime() {
        return createTime;
    }

    public void setCreateTime(long createTime) {
        this.createTime = createTime;
    }

    public int getCnt() {
        return cnt;
    }

    public void setCnt(int cnt) {
        this.cnt = cnt;
    }

    public int getParticipantNumber() {
        return participantNumber;
    }

    public void setParticipantNumber(int participantNumber) {
        this.participantNumber = participantNumber;
    }

    public int getBrowseNumber() {
        return browseNumber;
    }

    public void setBrowseNumber(int browseNumber) {
        this.browseNumber = browseNumber;
    }

    public List<TaskAtta> getAttachments() {
        return attachments;
    }

    public void setAttachments(List<TaskAtta> attachments) {
        this.attachments = attachments;
    }

    public UserInfo getUser() {
        return user;
    }

    public void setUser(UserInfo user) {
        this.user = user;
    }


    public static ProTalkDetail parse(JsonObject obj) {
        ProTalkDetail bean = new Gson().fromJson(obj, ProTalkDetail.class);
        if (TextUtils.isEmpty(bean.getUser().getAvatar())) {
            bean.getUser().setAvatar("NA");
        }
        return bean;
    }

}
